const fs = require('fs')
const path = require('path')

var  str='/a/b/c/index.html'
console.log(path.basename(str))  //  index.html

var   str2=path.join(__dirname,'04path2.js')
console.log(path.basename(str2)) //  04path2.js


console.log(__filename)  // C:\Users\Administrator\Desktop\ajax_060\node\day01\04path3.js
console.log(path.basename(__filename))  //  04path3.js


// =======
console.log(path.basename(__filename,'.js'))  //  04path3
console.log(path.extname(__filename))  //  .js